Sample code for the article on Gemini CLI vs Claude Code#751
Sample code for the article on Gemini CLI vs Claude Code#751
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new top-level sample-code folder for the “Gemini CLI vs Claude Code” Real Python article, containing two separate CLI to-do implementations (one per tool) plus accompanying unit tests.
Changes:
- Added
gemini-cli-vs-claude-code/README.mdlinking the sample code to the tutorial. - Added a simple JSON-backed to-do CLI implementation and tests under
gemini-cli/. - Added a more modular CLI + persistence layer implementation and tests under
claude-code/.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| gemini-cli-vs-claude-code/README.md | Documents the purpose of the sample-code folder and links to the article. |
| gemini-cli-vs-claude-code/gemini-cli/todo.py | Implements a basic CLI + in-class JSON persistence for tasks. |
| gemini-cli-vs-claude-code/gemini-cli/test_todo.py | Adds unit tests for the TodoManager implementation. |
| gemini-cli-vs-claude-code/claude-code/todo.py | Implements a modular CLI with command handlers and formatted output. |
| gemini-cli-vs-claude-code/claude-code/todo_store.py | Adds a dedicated JSON persistence layer with validation and helpers. |
| gemini-cli-vs-claude-code/claude-code/test_todo.py | Adds store-level and CLI integration tests using a temporary tasks file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| def _fmt_task(task: dict) -> str: | ||
| status = CHECK if task["completed"] else EMPTY | ||
| suffix = f" (done {task['completed_at'][:10]})" if task["completed_at"] else "" # noqa |
There was a problem hiding this comment.
The # noqa: E501 on this line is unnecessary because E501 is globally ignored in this repo; Ruff will report it as an unused noqa (RUF100) and fail CI. Remove the noqa (or only keep it if you enable E501 checks again).
| suffix = f" (done {task['completed_at'][:10]})" if task["completed_at"] else "" # noqa | |
| suffix = f" (done {task['completed_at'][:10]})" if task["completed_at"] else "" |
| @@ -0,0 +1,72 @@ | |||
| import json # noqa: F401 | |||
There was a problem hiding this comment.
json is imported but never used, and the # noqa: F401 is only masking that. Removing the unused import (and the noqa) will keep the example cleaner and avoid normalizing noqa usage in sample code.
| import json # noqa: F401 |
|
|
||
| import json | ||
| import os | ||
| import sys # noqa: F401 |
There was a problem hiding this comment.
sys is imported but not used; the # noqa: F401 is only suppressing the lint. Consider removing the unused import (and the noqa) to keep the test module clean.
| import sys # noqa: F401 |
Removed unused import of sys in test_todo.py
Comment out the unused import of json.
Where to put new files:
my-awesome-articleHow to merge your changes: